﻿using ECMS.Infrastructure.Domain;
using System;
using System.Collections.Generic;
using System.Text;

namespace ECMS.Domain.Models
{
    /// <summary>
    /// 主题
    /// </summary>
    public class Forum : EntityCore
    {
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public int AppUserId { get; set; }

        public virtual AppUser _appUser { get; set; }
        /// <summary>
        /// 帖子类型
        /// </summary>
        public string Type { get; set; }
        /// <summary>
        /// 发帖内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 审核
        /// </summary>
        public bool IsCheck { get; set; } = true;
        /// <summary>
        /// 点赞
        /// </summary>
        public int Hot { get; set; }
        /// <summary>
        /// 浏览量
        /// </summary>
        public int Look { get; set; }
        /// <summary>
        /// 显示签名
        /// </summary>
        public bool IsShowQM { get; set; } = false;
        /// <summary>
        /// 审核人
        /// </summary>
        public int SysUserId { get; set; }
        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime AuditTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; } = 0;
       
        protected override void Validate()
        {
            //if (string.IsNullOrEmpty(Mobile))
            //    AddBrokenRule(new BusinessRule(nameof(Mobile), "手机号不能为空."));
            //if (string.IsNullOrEmpty(Password))
            //    AddBrokenRule(new BusinessRule(nameof(Password), "登录密码不能为空."));
        }
    }
}
